package ctrip.api.flight.trade.common.commondata.v1;

import com.ctrip.soa.common.types.v1.ResponseStatusType;
import ctrip.api.flight.trade.common.basetype.v1.TradeErrorListType;

import javax.xml.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;


@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "FdPolicySearchResponseType", propOrder = {
    "responseStatus",
    "tradeResult"
})
@XmlRootElement(name = "FdPolicySearchResponse")
public class FdPolicySearchResponseType {

    @XmlElement(name = "ResponseStatus", required = true)
    protected ResponseStatusType responseStatus;

    @XmlElement(name = "TradeResult", required = true)
    protected FdPolicySearchResponseType.TradeResult tradeResult;

    public ResponseStatusType getResponseStatus() {
        return responseStatus;
    }

    public void setResponseStatus(ResponseStatusType value) {
        this.responseStatus = value;
    }

    public TradeResult getTradeResult() {
        return tradeResult;
    }

    public void setTradeResult(TradeResult value) {
        this.tradeResult = value;
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
            "errorList",
            "searchResultList"
    })
    public static class TradeResult {

        @XmlElement(name = "ErrorList")
        protected TradeErrorListType errorList;

        @XmlElement(name = "SearchResultList", required = true)
        protected FdPolicySearchResponseType.TradeResult.SearchResultList searchResultList;


        public TradeErrorListType getErrorList() {
            return errorList;
        }


        public void setErrorList(TradeErrorListType value) {
            this.errorList = value;
        }


        public FdPolicySearchResponseType.TradeResult.SearchResultList getSearchResultList() {
            return searchResultList;
        }


        public void setSearchResultList(FdPolicySearchResponseType.TradeResult.SearchResultList value) {
            this.searchResultList = value;
        }


        @XmlAccessorType(XmlAccessType.FIELD)
        @XmlType(name = "", propOrder = {
                "searchResults"
        })
        public static class SearchResultList {

            @XmlElement(name = "SearchResult")
            private List<SearchResult> searchResults;

            public List<SearchResult> getSearchResults() {
                return searchResults;
            }

            public void setSearchResults(List<SearchResult> searchResults) {
                this.searchResults = searchResults;
            }

            @XmlAccessorType(XmlAccessType.FIELD)
            @XmlType(name = "", propOrder = {
                    "route",
                    "totalCount",
                    "fdPolicyList"
            })
            public static class SearchResult {

                @XmlElement(name = "Route")
                private String route;

                @XmlElement(name = "Count")
                protected int totalCount;

                @XmlElement(name = "FdPolicyList")
                protected FdPolicySearchResponseType.TradeResult.SearchResultList.SearchResult.FdPolicyList fdPolicyList;

                public int getTotalCount() {
                    return totalCount;
                }

                public void setTotalCount(int value) {
                    this.totalCount = value;
                }

                public FdPolicySearchResponseType.TradeResult.SearchResultList.SearchResult.FdPolicyList getPolicyList() {
                    return fdPolicyList;
                }

                public void setPolicyList(FdPolicySearchResponseType.TradeResult.SearchResultList.SearchResult.FdPolicyList value) {
                    this.fdPolicyList = value;
                }

                public String getRoute() {
                    return route;
                }

                public void setRoute(String route) {
                    this.route = route;
                }


                @XmlAccessorType(XmlAccessType.FIELD)
                @XmlType(name = "", propOrder = {
                        "policy"
                })
                public static class FdPolicyList {

                    @XmlElement(name = "FdPolicy")
                    protected List<FdPolicyDataType> policy;

                    public List<FdPolicyDataType> getPolicy() {
                        if (policy == null) {
                            policy = new ArrayList<>();
                        }
                        return this.policy;
                    }

                }

            }
        }

    }

}
